package com.lyd.feign.demo.feign.client;

import com.lyd.feign.demo.feign.dto.TestDto;
import com.lyd.feign.demo.feign.dto.ValidParamDto;
import com.lyd.sweet.model.ResponseObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "web-demo", url = "${feign.client.web-demo-url:}")
public interface TestFeignClient {

    @PostMapping(value = "/api/v1/test/test", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    Boolean test(ValidParamDto dto);

    @PostMapping("/api/v1/test/test2")
    Boolean test2(@RequestBody ValidParamDto dto);

    @PostMapping("/api/v1/test/test2")
    ResponseObject<Boolean> test22(@RequestBody ValidParamDto dto);

    @GetMapping("/api/v1/test/test3")
    Boolean test3();

    @PostMapping(value = "/api/v1/test/upload2", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    String test10(TestDto testDto);

    @PostMapping(value = "/api/v1/test/upload2", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    ResponseObject<String> test11(TestDto testDto);
}
